package com.xdkj.es.dao;

import com.xdkj.es.entity.Goods;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * @author joke
 * @version 1.0
 * @date 2021/12/18-14:27
 */
public interface GoodsRepository extends ElasticsearchRepository<Goods, Integer> {
    //自定义查询语句 书写规则和springDataJpa一致
    @Query("{\"match\":{\"goodsId\":{\"query\":\"?0\"}}}")
    Goods findByGoodsIdValue(Integer id);
}

